{extend name="public:base" /}
{block name="head"}
<link href="__PUBLIC__/view_res/mobile/css/wshop_companyreg.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/lib/weui.min.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/css/jquery-weui.min.css" type="text/css" rel="Stylesheet" />
<script src="__PUBLIC__/jquery-weui/dist/js/jquery-weui.min.js"></script>
{/block} 

{block name="header"}
{include file="public/top-nav" /}
{/block}

{block name="content"}   

<!-- from -->
<form id="login-wrap">
    <input type="hidden" name="uid" value="{$userinfo.uid}"  tabindex="2" />

    <header class="Thead">旧密码</header>
    <div style="margin:0 10px;">
        <div class="gs-text">
            <input type="password" name="oldpassword" value=""  tabindex="2" placeholder="请输入旧密码" />
        </div>
    </div>

    <header class="Thead">新密码</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="password" name="password" value=""  tabindex="3" placeholder="请输入新密码" />
        </div>
    </div>

    <header class="Thead">确认新密码</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="password" name="pwd2" value="" tabindex="4" placeholder="再次输入新的密码" />
        </div>
    </div>
</form>

<a class="button green" href="javascript:;" id="reg-btn">确认修改</a>


{/block}
{block name="script"}
<script>
$('#reg-btn').click(function(){

	$.post(
			'{:url("user/updateuserpasswd")}',	
		$('input[type="password"],input[type="password"],input[type="hidden"]'),
		function(d){
			if(d.error){
				$.toast(d.error, "forbidden");
			}else if(d.success){
				$.toast(d.success);
				
				setTimeout(function (){
			      history.go(-1);
			    },2000);
			}
		}
	);
});
</script>
{/block}